import axios from "./axios";
import { processResponse } from "./util";

export default {
	// 成员列表
  memberListFun(query) {
    return processResponse(axios.get("/user/list-admin", { query }));
  },
  // 方案列表
  schemeList(id, query) {
    return processResponse(axios.get("/scheme/query", { query }));
  },
  // 方案删除
  schemeDeleteFun(id,query) {
    return processResponse(axios.delete("/scheme/" + id,  {query} ));
  },
  // 成员编辑
  userEdit(query) {
    return processResponse(axios.put("/user",  query ));
  },
  // 成员新增
  userAdd(query) {
    return processResponse(axios.post("/user",  query ));
  },
  // 成员删除
  deleteUserFun(id,query) {
    return processResponse(axios.delete("/user/" + id,  query ));
  },
  // 获取成员id信息
  userGet(id,query) {
    return processResponse(axios.get("/user/" + id,  {query} ));
  },
  // 方案新增
  schemeAdd(query) {
    return processResponse(axios.post("/scheme",  query ));
  },
  // 方案编辑
  schemeEdit(query) {
    return processResponse(axios.put("/scheme",  query ));
  },
  // 获取方案id信息
  schemeId(id, query) {
    return processResponse(axios.get("/scheme/" + id,  {query} ));
  },
  // 获取app列表
  appGet(query) {
    return processResponse(axios.get("/app/query",  query ));
  },
  // 获取course列表
  courseGet(query) {
    return processResponse(axios.get("/course/query",  query ));
  },
   // 重置密码
  restPassword(query) {
    return processResponse(axios.post("/user/reset", query ));
  },
};
